home *** CD-ROM | disk | FTP | other *** search
/ Programming Sound Cards / Programming Sound Cards.iso / sound_14 / vroomdma.c < prev    next >
C/C++ Source or Header  |  1995-01-01  |  742b  |  53 lines

  1. #include <blaster.h>
  2.  
  3. status_type    voice_stat;
  4.  
  5. void key_check()
  6. {
  7.     char ch;
  8.     while(voice_stat!=0)
  9.     {
  10.         if (kbhit())
  11.         {
  12.             ch=    getch();
  13.             if (ch==27)
  14.                 stop_snd();
  15.             if (ch==32)
  16.             {
  17.                 pause_snd();
  18.                 getch();
  19.                 cont_snd();
  20.             }
  21.         }
  22.     }
  23. }
  24.  
  25. void main()
  26. {
  27.     int        loop;
  28.     sbvoc_type    snd;
  29.     if (load_drv()!=SBOK)
  30.     {
  31.         printf("\nError loading driver.\n");
  32.         exit(1);
  33.     }
  34.     if (init_drv()!=SBOK)
  35.     {
  36.         printf("\nError initializing driver.\n");
  37.         uninstall_drv();
  38.         exit(1);
  39.     }
  40.     if (load_snd("vroom.voc",&snd)!=SBOK)
  41.     {    
  42.         printf("\nError loading file.\n");
  43.         uninstall_drv();
  44.         exit(1);
  45.     }
  46.     set_status(&voice_stat);
  47.     play_snd(snd);
  48.     key_check();
  49.     unload_snd(snd);
  50.     uninstall_drv();
  51.     exit(0);
  52. }
  53.